using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

#if (WinForms)
  using System.Windows.Forms;
#else
  using cs2335.CCT;
#endif


    class Demo2
    {

        static void Main()
        {
            Console.WriteLine("Starting...");


	    Button myButton = new Button();
	    myButton.Click += new EventHandler(Demo2.gotClick);
	    myButton.Location=new Point(50, 50);
	    myButton.Text = "Hi!";

	    #if (WinForms)
            	Form form = new Form();
		form.Controls.Add(myButton);
	    #else
		CCTForm form = new CCTForm();
		form.Add(myButton);
	    #endif

	    myButton.Click += new EventHandler(Demo2.gotClick);
	    myButton.Location=new Point(50, 50);
	    myButton.Text = "Hi!";

            System.Windows.Forms.Application.Run(form);
            Console.WriteLine("Done");
        }

        static void gotClick(object sender, EventArgs e)
        {
            Console.WriteLine("I got a click event");
        }
    }